package bairui.international.weixin.portal.miniapp.config;

import java.io.IOException;

import javax.annotation.PostConstruct;

import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import bairui.international.service.Service_City;
import bairui.international.service.Service_Province;
import bairui.international.service.Service_Town;

@Configuration
public class Config_Init {

	@Autowired(required=false) private RestHighLevelClient client;
	@Autowired private Service_Province service_Province;
	@Autowired private Service_City  service_City;
	@Autowired private Service_Town service_Town;

    @PostConstruct
    public void init() throws IOException{
    	if(null != client){
    		bairui.international.weixin.portal.miniapp.util.Util_ElasticSearch.init(client, service_Province, service_City, service_Town);
    	}
    }

}
